Currently, with the development of networks, people have more and more requirements for networks, especially, for large-capacity information such as music and video files, which gives rise to popularity of a P2P application. In most circumstances, however, the P2P application is unable to find a best peer sequence, which leads to performance deterioration of a server and too much inter-domain traffic. The P2P application occupies plenty of network bandwidths and limited network resources of an operator. Therefore, it is important to optimize P2P traffic.
The Application-Layer Traffic Optimization (ALTO) working group of the Internet Engineering Task Force (IETF) is committed to formulating a technical standard for application-layer traffic optimization that is performed based on cooperation between an Internet Service Provider (ISP) and a P2P application provider. The standard provides an ALTO service through the ISP, and optimizes selection of P2P resources by collecting and analyzing network topology information, with a view to reducing futile inter-domain traffic, using network bandwidth resources reasonably, and enhancing management on a P2P service.
When starting a P2P program, a client needs to requests a peer list from a P2P application server. The P2P application server may obtain network topology information through the ALTO service, optimize peer selection by using the network topology information, and return a list of preferred peers. For example, a user in Beijing may preferentially exchange a file fragment with another user in Beijing in this way.
In the process of implementing the present invention, the inventor finds that the conventional art has the following problems: No standard related to P2P traffic optimization is defined; an existing method for obtaining network topology information may enable the P2P application server to obtain lower-layer network topology information, but the amount of the lower-layer network topology information is too large and details of the operator are exposed excessively, which brings many security problems to an upper-layer application. Moreover, the large amount of transmitted network topology information seriously increases a network load, especially in an unstructured P2P network, and therefore the lower-layer network topology information is not suitable for being transmitted to the P2P application server for helping to optimize the peer selection.